From: Ian Campbell Date: Mon, 21 Jul 2014 12:59:59 +0000 (+0100) Subject: xen: arm: ensure that the boot code is <4K in size X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~4612 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/success//%22http:/www.example.com/cgi/success/?a=commitdiff_plain;h=6d848a95df61a76bdf9069b4ba9286d6358784d8;p=xen.git xen: arm: ensure that the boot code is <4K in size This avoids having to deal with the 1:1 boot mapping crossing a section or page boundary. Signed-off-by: Ian Campbell Acked-by: Julien Grall --- diff --git a/xen/arch/arm/arm32/head.S b/xen/arch/arm/arm32/head.S index 0a95b68b56..2547ce1d6d 100644 --- a/xen/arch/arm/arm32/head.S +++ b/xen/arch/arm/arm32/head.S @@ -457,6 +457,8 @@ fail: PRINT("- Boot failed -\r\n") 1: wfe b 1b +GLOBAL(_end_boot) + /* Copy Xen to new location and switch TTBR * r1:r0 ttbr * r2 source address diff --git a/xen/arch/arm/arm64/head.S b/xen/arch/arm/arm64/head.S index 4f0ea2dca2..b71b6f0812 100644 --- a/xen/arch/arm/arm64/head.S +++ b/xen/arch/arm/arm64/head.S @@ -487,6 +487,8 @@ fail: PRINT("- Boot failed -\r\n") 1: wfe b 1b +GLOBAL(_end_boot) + /* Copy Xen to new location and switch TTBR * x0 ttbr * x1 source address diff --git a/xen/arch/arm/xen.lds.S b/xen/arch/arm/xen.lds.S index be55dad4da..079e0851c7 100644 --- a/xen/arch/arm/xen.lds.S +++ b/xen/arch/arm/xen.lds.S @@ -178,3 +178,9 @@ SECTIONS .stab.indexstr 0 : { *(.stab.indexstr) } .comment 0 : { *(.comment) } } + +/* + * We require that Xen is loaded at a 4K boundary, so this ensures that any + * code running on the boot time identity map cannot cross a section boundary. + */ +ASSERT( _end_boot - start <= PAGE_SIZE, "Boot code is larger than 4K")